<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
	<head>
		<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
		<title>换证申请增加-金融风险管理系统</title>
		<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/scriptvalidator.js" type="text/javascript"></script>
		<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
		<script language='javascript'>
		function checkSubmit(){
	     	var staffForm = document.form1;
			if(!Validator.Validate(staffForm, 3)) {
				return false;
			}
			if((!$("#sel_cf_vals").val()) && $("#operate").val() == "checkin"){
				alert("请至少选择一个换出车架号！");
				return false;
			}
			
			if($("#operate").val() == "checkin" && parseFloat($("#supplyPrice").text()) > parseFloat($("#inMoney").text())){
				if(!confirm("换出金额大于换入金额，确认要提交吗?")){
					return false;
				}
			}
			<s:if test="entity.inCertificateRenews == null || entity.inCertificateRenews.size() < 1">
				if($("#operate").val() == "checkin"){
					alert("换入合格证数量为0,请增加换入合格证。");
					return false;
				}else{
					return true;
				}
			</s:if>
			<s:else>
				return true;
			</s:else>
		 }
		 
		  $(document).ready(function(){
				$('[type=button]').click(function(e){
					$("#operate").val(e.target.id);
					$("#form1").submit();
				}); 
				
				});
		</script>
	</head>
	<body  leftmargin='8' topmargin='8'>

	<div class="navigation">
	    <span><a href="javascript:window.history.back();"><img src="${contextPath}/images/back_nav_btn.png" /></a>
	    <a href="javascript:window.history.back();">返回</a>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>合格证管理&gt;&gt;换证&gt;&gt;新增
    
  	</div>
  	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
			<tr>
				<td align="center" valign="top" bgcolor="#FFFFFF">
					<div class="xt_main_right_center">
					<form id="form1" name="form1" action="create.do" method="post"  enctype="multipart/form-data" onsubmit="javascript:return checkSubmit();">
						<%@ include file="form.jsp"%>
					</form>
					</div>
				</td>
				
			</tr>
	</table>
	
	</body>
</html>